package TI;

import java.util.List;

import Exceptions.ProductSalesPriceNeverSetException;
import Magnitudes.Money;
import Magnitudes.Percentage;
import Magnitudes.Pesos;
import Products.Presentation;

public class Offers extends Offer {

	private List<Offer> offers;
	
	public Offers(List<Offer> offers, Percentage discount){
		this.discount = discount;
		this.offers = offers;
	}
	
	
	@Override
	public Money getPrice() throws ProductSalesPriceNeverSetException{
		Pesos acum = new Pesos(0);
		for (Offer current: this.offers){
				acum = acum.add(current.getPrice());
		}
		return acum.subPercentage(this.discount);
	}

	
}
